package companysynopsis.action;
import com.opensymphony.xwork2.ActionSupport;
import companysynopsis.dao.SynopsisDao;
import companysynopsis.model.Synopsis;

public class SynopsisAction extends ActionSupport{
	
	private static final long serialVersionUID = 1L;
	private SynopsisDao synopsisDao;
	private Synopsis synopsis;
	
	
	public SynopsisDao getSynopsisDao() {
		return synopsisDao;
	}
	public void setSynopsisDao(SynopsisDao synopsisDao) {
		this.synopsisDao = synopsisDao;
	}
	public Synopsis getSynopsis() {
		return synopsis;
	}
	public void setSynopsis(Synopsis synopsis) {
		this.synopsis = synopsis;
	}
	public String toSynopsis(){
		
		Synopsis synopsis2 = new Synopsis();
		synopsis2.setSynopsis("测试");
		synopsisDao.saveOrUpdate(synopsis2);
		synopsis = synopsisDao.findById(1L);
		return SUCCESS;
	}
	public String toSynopsisAdmin(){
		System.out.println("111111111111111111");
		synopsis = synopsisDao.findById(1L);
		return SUCCESS;
	}
	public String saveSynopsis(){
		System.out.println("222222222222");
		System.out.println(synopsis.getId());
		synopsisDao.update(synopsis);
		return SUCCESS;
	}

}
